<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="d" uri="/WEB-INF/resource.tld" %>

<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  
</head>

<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/menu.jsp"%>
  
  <div class="container main-content">
  
    <div class="panel panel-default x-panel x-panel-layout">
    
      <div class="panel-heading">
        <ol class="breadcrumb">
          <li><a href="${ctx.host }/user">用户管理</a></li>
          <li class="active">授权用户</li>
        </ol>
      </div>
      
      <div class="panel-body">
      
        <div class="col-xs-2 x-panel-layout-left no-horizontal-padding">
          <%@ include file="/WEB-INF/include/submenu.jsp"%>
        </div>
        
        <div class="col-xs-10 x-panel-layout-right">
        
          <div class="x-breadcrumb-wrapper">
            <div class="x-breadcrumb clearfix">
              <h2><i class="glyphicon glyphicon-fire"></i>&nbsp;&nbsp;<span>授权用户&nbsp;-&nbsp;用户详情</span></h2>
            </div>
          </div>
          
          <div class="x-breadcrumb-wrapper ">
         
            <div class="x-breadcrumb-wrapper">
              <ul class="nav nav-pills x-breadcrumb-nav ajax-tab" data-content="#tab-content" data-operation="#tab-operation">
                <li class="pull-left active"><a id="profile" href="${ctx.host}/users/${user.id}" data-toggle="tab" data-target="#student-profile">基本信息</a></li>
                <li class="pull-left"><a id="body" href="${ctx.host}/users/${user.id}/body" data-toggle="tab" data-target="#student-body">身体信息</a></li> 
                <li class="pull-left"><a id="course" href="${ctx.host}/users/${user.id}/course" data-toggle="tab" data-target="#student-course">课程信息</a></li> 
                <li class="pull-left"><a id="record" href="${ctx.host}/users/${user.id}/input-info" data-toggle="tab" data-target="#student-record">档案信息</a></li> 
            	<li class="pull-left"><a id="address" href="${ctx.host}/users/${user.id}/address" data-toggle="tab" data-target="#student-address">地址信息</a></li>
                <%-- <li class="pull-left active">
                  <a id="info" href="${ctx.host}/users/${user.id}" data-toggle="tab" data-target="#user-info">基本信息</a>
                </li>       
                <li class="pull-left">
                  <a id="profile" href="${ctx.host}/users/${user.id}/profile" data-toggle="tab" data-target="#user-profile">个人信息</a>
                </li>
                <li class="pull-left">
                  <a id="record" href="${ctx.host}/users/${user.id}/input-info" data-toggle="tab" data-target="#user-record">录入档案</a>
                </li> --%>
              </ul>
              
              <!-- tab operations -->
              <c:if test="${!currentPrincipal.siteServer}">
                <div id="tab-operation" class="tab-operation pull-right">
                  <div id="profile-operation" class="tab-operations hide">
                    <a href="${ctx.host }/users/${user.id}/name" data-target="#profile-edit" data-toggle="modal" title="编辑">编辑姓名</a>
                  </div>
                  <%-- <div id="profile-operation" class="tab-operations hide">
                    <a href="${ctx.host }/users/${user.id}/profile/edit" data-target="#profile-edit" data-toggle="modal" title="编辑">编辑</a>
                  </div> --%>
                </div>
              </c:if>
              
            </div>
            
            <div id="tab-content" class="tab-content ajax-tab-content">
            
              <div class="tab-pane fade active in" id="student-profile" style="min-height: 100px;">
            
                <div class="form-horizontal">
                  <div class="form-group">
                    <label class="control-label col-xs-2">姓名：</label>
                    <div class="col-xs-4 pull-left">
                      <p class="form-control-static">${user.name}</p>
                    </div>
                  </div>
                    
                  <div class="form-group">
                    <label class="control-label col-xs-2">手机：</label>
                    <div class="col-xs-4 pull-left">
                      <p class="form-control-static">${user.mobile}</p>
                    </div>
                    <label class="control-label col-xs-2">创建时间：</label>
                    <div class="col-xs-4 pull-left">
                      <p class="form-control-static">
                        <fmt:formatDate value="${user.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
                      </p>
                    </div>
                  </div>
                  
                  <div class="form-group">
                    <label class="control-label col-xs-2">国-省-市-区：</label>
                    <div class="col-xs-4 pull-left">
                      <p class="form-control-static">${user.profile.country}&nbsp;-&nbsp;${user.profile.province}&nbsp;-&nbsp;${user.profile.region}&nbsp;-&nbsp;${user.profile.district}</p>
                    </div>
                  </div>
                  
                  <div class="form-group">
                    <label class="control-label col-xs-2">收货地址：</label>
                    <div class="col-xs-6 pull-left">
                      <p class="form-control-static">${user.profile.address}</p>
                    </div>
                  </div>
                  
                  <div class="form-group">
                  <label class="control-label col-xs-2">微信二维码：</label>
                    <div class="col-xs-4 pull-left">
                      <p class="form-control-static">
                       <a href="#"><span class="glyphicon glyphicon-download" aria-hidden="true"></span>&nbsp;下载</a>
                      </p>
                    </div>
                   <label class="col-xs-2 control-label">头像：</label>
                   <div class="col-xs-4 pull-left">
                     <c:choose>
                       <c:when test="${empty student.avatar}">
                         <p class="form-control-static">${user.profile.avatar}</p>
                       </c:when>
                       <c:otherwise>
                         <img src="${qiniu.prod}/${user.profile.avatar}-qrcode">
                       </c:otherwise>
                     </c:choose>
                   </div>
                 </div>
                     
               </div>
             </div>
             
            </div>
            
           <%-- <div class="x-breadcrumb-wrapper">
             <ul class="nav nav-pills x-breadcrumb-nav ajax-tab" data-content="#fit-content" data-operation="#fit-operations">
                 <li class="pull-left">
                   <a id="fit" href="${ctx.host}/users/${user.id}/fit" data-toggle="tab" data-toggle="tab" data-target="#user-fit">健身数据</a>
                 </li>
                 <li class="pull-left">
                   <a id="inbody" href="${ctx.host}/users/${user.id}/inbody" data-toggle="tab" data-toggle="tab" data-target="#user-inbody">Inbody数据</a>
                 </li>
                 <li class="pull-left">
                   <a id="bwh" href="${ctx.host}/users/${user.id}/bwh" data-toggle="tab" data-toggle="tab" data-target="#user-bwh">三围数据</a>
                 </li>
                 <li class="pull-left">
                   <a id="target" href="${ctx.host}/users/${user.id}/target-data" data-toggle="tab" data-toggle="tab" data-target="#user-target">目标数据</a>
                 </li>
             </ul>
             
             <!-- tab operations -->
             <c:if test="${!currentPrincipal.siteServer}">
               <div id="wechat-operations" class="tab-operation pull-right">
                 <div id="fit-operation" class="tab-operations hide">
                   <a href="${ctx.host }/users/${user.id}/fit/edit" data-target="#fit-edit" data-toggle="modal" title="编辑">编辑</a>
                 </div>
               </div>
             </c:if>
           </div>
           
           <div id="fit-content" class="tab-content ajax-tab-content">
           </div> --%>
           
         </div>
        </div>
      </div>
    </div>
  </div>

 <%@ include file="/WEB-INF/include/script.jsp"%>
 <d:resource root="${ctx.resource}/build" type="script" src="js/page/user/user-view.js">
    <script type="text/javascript">
      require(['page/user/user-view'], function(page) {
        page.init()
      })
    </script>
  </d:resource>
  
</body>
</html>